/* 核心布局 */
.products-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

/* 产品卡片 */
.product-card {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    transition: transform 0.2s;

    &:hover {
        transform: translateY(-5px);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    }
}

.product-logo {
    height: 120px;
    object-fit: contain;
    padding: 1rem;
}

/* 添加卡片 */
.add-card {
    border: 2px dashed #bdbdbd;
    background: #f5f5f5;
    padding: 2rem; /* 保持与产品卡片内边距一致 */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s;

    &:hover {
        border-color: #2196F3;
        background: rgba(33, 150, 243, 0.05);
    }
}


.active-card {
    border: 2px solid #2196F3 !important;
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.15);
}

/* 选择器同步样式 */
.product-selector .dropdown-item.active {
    background: #e3f2fd;
    color: #2196F3 !important;
}

/* 空状态特殊处理 */
[data-empty="true"] .products-container {
    height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
}


/* 分页 */
.pagination {
    margin-top: 2rem; /* 与图片底部间距一致 */
}

.page-item.active .page-link {
    background-color: #2196F3;
    border-color: #2196F3;
}

.page-link {
    color: #2A3950;
    min-width: 40px;
    text-align: center;
}

.page-link:hover {
    color: #1565C0;
}


/* 分页样式 */
#pagination {
    margin: 2rem 0;
}

.page-item.active .page-link {
    background-color: #2196F3;
    border-color: #2196F3;
    color: white !important;
}

.page-link {
    color: #2A3950;
    min-width: 40px;
    text-align: center;
    margin: 0 3px;
    border-radius: 0.5rem !important;
    border: 1px solid transparent;
}

.page-link:hover {
    color: #1565C0;
    background-color: #e3f2fd;
    border-color: #90caf9;
}

/* 空状态 */
#products-container[data-empty="true"] {
    border: 2px dashed #e0e0e0;
    border-radius: 1rem;
}

.page-arrow {
    min-width: 40px;
    border: 1px solid #dee2e6 !important;
    color: #2A3950 !important;
    background: white !important;
    border-radius: 0 !important;
}

/* 数字按钮样式 */
.page-number {
    min-width: 40px;
    border: 1px solid #dee2e6;
    color: #2A3950;
    border-radius: 0;
}

/* 禁用状态统一 */
.page-item.disabled .page-link {
    background: #f8f9fa !important;
    border-color: #dee2e6 !important;
    color: #6c757d !important;
}

/* 激活状态 */
.page-item.active .page-link {
    background: #2196F3 !important;
    border-color: #2196F3 !important;
    color: white !important;
}

/* 按钮间距修正 */
#pagination .page-item {
    margin: 0 2px;
}


/* 弹窗容器 */
.add-product-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1050;
}

.add-product-modal.active {
    display: block;
}

/* 遮罩层 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
}

/* 内容区（严格匹配图片布局） */
.modal-content {
    position: fixed;
    right: 0;
    top: 0;
    width: 500px;
    height: 100vh; /* 100%视口高度 */
    background: white;
    box-shadow: -4px 0 12px rgba(0, 0, 0, 0.1);
    transform: translateX(100%); /* 初始隐藏 */
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 激活状态 */
.add-product-modal.active .modal-content {
    transform: translateX(0);
}


/* 内容滚动区 */
.modal-body {
    height: calc(100vh - 120px); /* 扣除头部和底部高度 */
    overflow-y: auto;
}

/* 上传区域交互 */
.upload-area {
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.upload-area:hover {
    border-color: #2196F3 !important;
    background: rgba(33, 150, 243, 0.05);
}

/* 按钮悬停效果 */
.btn-outline-primary:hover {
    background: #2A3950;
    color: white !important;
}

.btn-primary:hover {
    background: #1565C0;
    border-color: #1565C0 !important;
}


/* Toast通知 */
.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    padding: 15px 25px;
    border-radius: 0;
    color: white;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 9999;
}

.toast.success {
    background: #2196F3;
    border-left: 4px solid #1565C0;
}

.toast.error {
    background: #f44336;
    border-left: 4px solid #c62828;
}

/* 上传预览 */
.upload-preview {
    text-align: center;
}

.preview-image {
    max-height: 80px;
    margin-bottom: 10px;
    object-fit: contain;
}